<?php

class Js
{
    static public function alert($msg)
    {
        echo "<script language='javascript'> alert('".str_replace("\n","\\n",$msg)."');</script>";
    }

    static public function gourl($url)
    {
        if($url==1)
            echo "<script language='javascript'>window.close();</script>";
        else if($url==-1)
            echo "<script language='javascript'>history.go(-1);</script>";
        else
            echo "<script language='javascript'>window.location.href='".$url."';</script>";
        exit;
        exit();
    }

    static public function openWin($url, $name = '', $properties = '')
    {
        echo '<script type="text/javascript">window.open("' . $url . '", "' . $name . '", "' . $properties . '");</script>';
    }
}